import React from 'react';

import BaseAction from '../common/BaseAction';
import Constants from '../../common/Constants';

export default class ActivityRequestEntryListAction extends BaseAction {
    constructor() {
        super();

        this.moduleType = Constants.MODULE_TYPE.ACTIVITY;
        this.name = "ActivityRequestEntryListAction";
    }

    call(caller, data) {
      this._baseCall(caller, data);
    }

    finish(data, isSucceed, response) {
      if(isSucceed) {
        this.caller.setState({
          entryData: data,
        })
      }
      else if (data) {
        if(data.status == 401) {
          this._dealUnauthorized(this.caller);
        }
        else {
          this.caller.setState({viewStatus: data.status})
        }
      }
      else {
        this.caller.setState({viewStatus: 400})
      }
    }
}
